<template>
  <view>
    <course-detail-list :details="details"></course-detail-list>
  </view>
</template>

<script>
import { courseDetails } from "@/api/api.js";
export default {
  data() {
    return {
      details: [],
      id: "",
      index: 0,
    };
  },
  onLoad(opts) {
    if (opts) {
      this.id = opts.id;
    }
    this.fetchlist();
  },
  methods: {
    async fetchlist() {
      //0/json?cid=549&order_type=1
      let res = await courseDetails(this.index, this.id);
      console.log("res", res);
      this.details = res.data.datas;
    },
  },
};
</script>

<style></style>
